package com.yanqu.road.server.cmd.banquet.party;

import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.banquet.CrossPartyMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_NEXT_FEAST_PARTY, desc = "")
public class CrossNextFeastPartyCmd extends CrossCommand {
    private int pageNum;
    private int pageSize;
    private long userId;
    private String curId;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossBanquetProto.BanquetEnterNextReq req = CrossBanquetProto.BanquetEnterNextReq.parseFrom(packet.getBytes());
        pageNum = req.getGroupId();
        pageSize = req.getGroupNum();
        userId = packet.getPlayerId();
        curId = req.getBanquetId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossPartyMgr.enterNextFeastParty(serverId, userId,curId, pageNum, pageSize);
    }

    @Override
    public void sendData() {

    }
}
